home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / util / logging / LOGGING.js < prev    next >
Encoding:
Text File  |  2007-04-11  |  1.7 KB  |  68 lines

  1. /****i* SOURCE_FILE/INFO
  2.   *
  3.   * NAME
  4.   *  LOGGING.js
  5.   *
  6.   * USAGE
  7.   *  Part of Netobjects JavaScript Library.
  8.   *
  9.   * COPYRIGHT
  10.   *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.   *  All Rights Reserved.
  12.   *
  13.   *  This is an unpublished work protected by Website Pros, Inc.
  14.   *  as a trade secret, and is not to be used or disclosed except as
  15.   *  expressly provided in a written license agreement executed by
  16.   *  you and Website Pros, Inc.
  17.   *
  18.   *      <copyright@websitepros.com>
  19.   *
  20.   * NOTES
  21.   *  JavaScript code.
  22.   *
  23.   *****/
  24.  
  25. if (!IS_isModuleInitialized("IS.NOF.UTIL.LOGGING"))
  26. {   
  27.   /****h* NOF_JavaScript_Library/NOF.UTIL.LOGGING
  28.     *
  29.     * NAME
  30.     *  NOF.UTIL.LOGGING
  31.     *
  32.     * DESCRIPTION
  33.     *  The NOF.LOGGING namespace and loggers manager.
  34.     *
  35.     ****/
  36.   function LOGGING() {
  37.     this.__proto__ = LOGGING.prototype;
  38.     this.type = IS.TYPE_NAMESPACE;
  39.     
  40.     this.loggers = new Array(); //actually, this is a hashtable
  41.   }
  42.   {
  43.     var method = LOGGING.prototype;
  44.     /** 
  45.     * method getLogger
  46.     */          
  47.     method.getLogger    = function getLogger (/*string*/name, /*NOF.UTIL.PropertyResourceBundle*/ bundle) {    
  48.       if ( arguments.length == 0 || name == null ) { //this should be the default logger
  49.         name = "LOGGING.DefaultLogger"; 
  50.       }
  51.       if (this.loggers[name] == null || typeof(this.loggers[name]) == "undefined") {       
  52.         try {
  53.           var nLogger = new LOGGING.Logger(name, bundle);
  54.           this.loggers[name] = nLogger;
  55.           
  56.         } catch(e) {
  57.           alert(""+e);
  58.         }                
  59.       }      
  60.       return this.loggers[name];
  61.     }
  62.   }
  63.   
  64.   // add LOGGING namespace to UTIL namespace
  65.   UTIL.__proto__.LOGGING = new LOGGING();
  66. }
  67. var LOGGING = UTIL.LOGGING;
  68.